<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class GenericModel extends CI_Model {
 
    function __construct() {
        parent::__construct();
    }
 
    function get($search, $collection) {
    	if($search==null || $collection==null){
    		return null;
    	}
    	 
        $query = $this->mongo_db->get_where($collection, $search);
        if($query){
        	return $query;
        }else{
        	return null;
        }
    }
     
    function insert($insert, $collection) {
    	if($insert==null || $collection==null){
    		return null;
    	}
    	
        $this->mongo_db->insert($collection, $insert);
    }
 
}
 
?>